package com.xjgc.msibase.controller;


import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 中间库服务测试
 *
 * @author: 小逗号
 * @date: 2023-11-17
 * @description:
 * @since:
 */
@Api(tags = "中间库服务测试")
@RestController
@RequestMapping("/msiws/MsiServerTest")
@Slf4j
public class MsiServerTestController {
/*

    @Resource
    private SapToMsiReal sapToMsiReal;
    @Resource
    private MsiRealHandle msiRealHandle;

    @ApiOperation("WebService服务测试")
    @PostMapping("/testWebService")
    public Result<?> testWebService(@RequestBody Map<String, String> map) {
        String response = "";
        String serverCode = map.get("serverCode");
        String taskCode = map.get("taskCode");
        String testData = map.get("testData");
        if ("SapToMsiReal".equals(serverCode)) {
            response = sapToMsiReal.realReceive(taskCode, System.currentTimeMillis() + "", testData, "MSI");
        } else {
            Result.error("WebService服务未找到:" + serverCode);
        }
        return Result.OK(response);
    }

    @ApiOperation("RestFull服务测试")
    @PostMapping("/testRestFull")
    public Result<?> testRest(@RequestBody Map<String, String> map) {
        String serverCode = map.get("serverCode");
        String taskCode = map.get("taskCode");
        String testData = map.get("testData");
        JSONObject jsonObject = JSONObject.parseObject(testData);
        Map param = JSONObject.toJavaObject(jsonObject, Map.class);
        param.put("serialNo", "TEST_" + System.currentTimeMillis());
        log.info("TEST==>{}", param);

        Result<?> result = msiRealHandle.handle(serverCode, taskCode, param);
        return result;
    }
*/


}
